package com.smedi.ismedi.personnel.core.port.adapter.persistence.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.smedi.ismedi.database.starter.model.BasicFieldEntity;

/**
 * @Author: xulinjun
 * @Date: 2021-6-7 16:08
 */
@Data
@TableName(value = "prs_person_basic")
public class PersonEntity implements Serializable {
    @TableField(value = "last_name")
    private String lastName;

    @TableField(value = "gender")
    private String gender;

    @TableField(value = "person_type")
    private String personType;

    @TableField(value = "internal")
    private boolean internal;

    @TableField(value = "employee_num")
    private String employeeNum;

    @TableField(value = "user_name")
    private String userName;

    @TableField(value = "mobile")
    private String mobile;

    @TableField(value = "email")
    private String email;

    @TableField(value = "office_telephone")
    private String officeTelephone;

    @TableField(value = "id_card")
    private String idCard;

    @TableField(value = "status")
    private String status;

    @TableField(value = "person_order",updateStrategy = FieldStrategy.IGNORED)
    private Integer personOrder = Integer.MAX_VALUE;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

    @TableField(value = "created_user_id", fill = FieldFill.INSERT)
    private Long createdUserId;

    @TableField(value = "created_date", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime createdDate;

    @TableField(value = "latest_updated_user_id", fill = FieldFill.INSERT_UPDATE)
    private Long latestUpdatedUserId;

    @TableField(value = "latest_updated_date", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime latestUpdatedDate;

    @TableField(value = "is_deleted", fill = FieldFill.INSERT)
    private boolean deleted;

    @TableField(value = "top_org_id")
    private String topOrgId;

    @TableField(value = "tenant_id")
    private String tenantId;
}
